<script setup>
import {cancelDoc} from "@/api/document/myDocument.js";
import {backMyDocList} from "@/utils/backList.js";

const {proxy} = getCurrentInstance()
const prop = defineProps({
  docId: {
    type: Number,
  },
  isCancel: {
    type: Boolean,
  }
})
function handleCancel() {
  proxy.$modal.confirmAndExecuteJS('确认要废弃当前公文记录？', cancelDoc, prop.docId, backMyDocList)
}

</script>

<template>
  <el-button type="info" @click="handleCancel" v-if="isCancel">废 弃</el-button>
</template>